<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
  <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  <link rel="stylesheet" href="../../css/animate.css">
  <link rel="stylesheet" href="../../iconfont/iconfont.css">
  <link rel="stylesheet" href="../../css/mescroll.css">
  <link rel="stylesheet" href="../../css/gloab.css">
  <title>头条预定</title>
  <style>
   .pay-div{
     width:96%;
     margin:auto;
     padding:0.1rem 0.1rem 0.4rem;
     border-bottom: 1px solid #e3e3e3;
   }
   .pay-div-content{
     width:96%;
     margin:auto;
     padding:0.3rem 0;
   }
  .pay-div-content span{
    display: inline-block;
    height: 0.45rem;
    /*line-height: 0.45rem;*/
    text-align: center;
    font-size: 0.3rem;
    color:#9e9e9e;
  }
  .pay-div-content img{
    display: inline-block;
    height: 0.6rem;
    text-align: center;
    font-size: 0.3rem;
    color:#9e9e9e;
  }
   .lt{
     float: left;
   }
   .rt{
     float: right;
   }
   .pay-button{
     width:96%;
     margin:auto;
     height: 1rem;
     text-align: center;
     line-height: 1rem;
     color:#fff;
     font-size: 0.3rem;
     background: #1b80d4;
     border-radius: 0.1rem;
   }
  </style>
</head>
<body>
  <div id="app">
    <div id="public-header">
      <div id="statusbar"></div>
      <header class="public-header">
        <div class="public-header-lf iconfont icon-fanhui" @click="api.closeWin()"></div>
        <div class="public-header-title"><span class="btn"></span>头条预定 <span class="btn"></span></div>
      </header>
    </div>
    <div class="pay-div" style="line-height:0.4rem;" v-html="toutiao">
    </div>
    <!-- <div class="pay-div" style="line-height:0.4rem;">
        1、建议先发布好二维码再抢，<font style="color:#1b80d4;" @click="javascript:api.openWin({name: 'fabu',url:'./fabu.html'});">点击这里发布；</font><br>
        2、抢购后三分钟未完成支付即释放名额，不可退订;
    </div> -->
    <div class="pay-div" style="text-align:center;padding:0.1rem;">
      当前可预定排队后的展示时间为：<br><font style="color:#f00;" v-if="touTiaoTime">{{touTiaoTime}}</font><font style="color:#f00;" v-else>立刻</font>
    </div>
    <!-- <div class="pay-div" style="text-align:center;border:none;width:80%;padding:0.1rem;">
      当前可预定排队后的展示的时间已超过<font style="color:#f00;">20</font>天，不建议预定，请于<font style="color:#f00;">03-20 15:33:52<font>时后预定
    </div> -->
</body>
<script src="../../script/api.js"></script>
<script src="../../script/mescroll.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/jquery-1.8.3.min.js"></script>
<script src="../../script/jsencrypt.js"></script>
<script src="../../script/fastclick.js"></script>

<script>
var vm;
var mescroll;
apiready=function(){
  setBar("statusbar");
  setFont(750);
  startVue();
  $(".public-progress").fadeOut(1000);
  setTimeout(function(){
    $(".public-progress").css({"display":"none"});
  },1000);
}
function startVue(){
  vm = new Vue({
    el:"#app",
    data:{
      list:[],
      res:[],
      postList:[],
      types:0,
      nickname:api.pageParam.nickname,
      release_price:api.pageParam.release_price,
      balance:'',
      pay:0,
      toutiao:'',
      touTiaoTime:'',
    },
    created:function(){
      this.getPrice();
      this.getToutiao();
      this.getToutiaoTime();
    },
    methods:{
      getToutiaoTime:function(){
        api.ajax({
            url: apiUrl+'api/home/getToutiaoTime',
            method: 'post',
            data: {
            }
        },function(ret, err){
            if (ret.status) {
              vm.touTiaoTime = ret.data;
            } else {
              vm.touTiaoTime = ret.data;
            }
        });
      },
      getToutiao:function(){
        api.ajax({
            url: apiUrl+'api/home/getToutiao',
            method: 'post',
            data: {
                values: {
                },
            }
        },function(ret, err){
            if (ret.status) {
              vm.toutiao = ret.data;
            } else {
              vm.toutiao = ret.data;
            }
        });
      },
      getPrice:function(){
        api.ajax({
            url: apiUrl+'api/users/getPrice',
            method: 'post',
            data: {
                values: {
                    uid: post_en($api.getStorage('uid')),
                },
            }
        },function(ret, err){
            if (ret.status) {
              vm.balance = ret.data;
            } else {
              msg(ret.msg);
            }
        });

      },
      //发布
      putOut:function(){
        msg('开发中，敬请期待......')
        return;
          var newStr = "";
          newStr += "{";
          for (var i = 0; i < vm.images.length; i++) {
              newStr += '"file' + i + '":"' + vm.images[i] + '",';
          }
          newStr += "}";
        api.ajax({
            url: apiUrl+'api/billing/addBilling',
            method: 'post',
            data: {
                values: {
                    uid: post_en($api.getStorage('uid')),
                    type:api.pageParam.type,
                    status:api.pageParam.status,
                    content:api.pageParam.content,
                    price:api.pageParam.price,
                    num:api.pageParam.num,
                    nickname:api.pageParam.nickname,
                    wechat:api.pageParam.wechat,
                    release_price:post_en(api.pageParam.release_price),
                },
                files: eval('(' + newStr +')')
            }
        },function(ret, err){
            if (ret.status) {
              api.toast({
                  msg: ret.msg,
                  duration: 2000,
                  location: 'middle'
              });
              setTimeout(function(){
              api.closeWin();
              },500);
            } else {
              api.toast({
                  msg: ret.msg,
                  duration: 2000,
                  location: 'middle'
              });
            }
        });

      },
    }
  })
}

</script>
</html>
